#ifndef MOVIE_H
#define MOVIE_H

#include "Image.h"

class Movie
{
public:
	Movie();
	~Movie();

	void SetDimension(unsigned int newWidth, unsigned int newHeight);
	void SetFrameCount(unsigned int newFrameCount);
	void ReadRawFromFile(const char *filename);
	void WriteRawToFile(const char *filename);
	bool EndOfMovie() const;
	void SeekNext();

	Image* CurrentFrame();
	Image* PreviousFrame();

	unsigned int Width() const { return width; }
	unsigned int Height() const { return height; }
	unsigned int FrameCount() const { return frameCount; }

protected:

private:
	unsigned int framePosition;
	Image *frames;
	unsigned int frameCount;
	unsigned int width, height;

	void AllocateFrames(unsigned int newFrameCount);
	void Clear();

};

#endif //MOVIE_H
